import java.util.Scanner;
import java.math.BigInteger;

public class Array_1_6_15 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n;
        BigInteger sum = BigInteger.valueOf(0);
        n = input.nextInt();
        for (int i = 1; i <= n; i++) {
            sum = sum.add(fact(i));
        }
        System.out.println(sum);
    }

    public static BigInteger fact(int x) {
        BigInteger sum = BigInteger.valueOf(1);
        for (int i = 1; i <= x; i++) {
            sum = sum.multiply(BigInteger.valueOf(i));
        }
        return sum;
    }
}